<?php
class safeController extends accessController{
    private $svc=null;
    
    public function __construct(){
        parent::__construct();
        $this->svc=load_service('safe');
    }
    
    public function index(){
        $user_info=$this->svc->get_user_info();
        include($this->viewer_dir.'safe/index.php');
    }
    public function mod_password(){
        if($_POST){
            $r=$this->svc->mod_password($_POST);
            if($r[0]){
                alert('密码修改成功！');
                back();
            }else{
                alert($r[1]);
                back();
            }
        }
    }
    public function mod_email(){
        if($_POST){
            $r=$this->svc->mod_email($_POST);
            if($r[0]){
                alert('邮箱修改成功！');
                back();
            }else{
                alert($r[1]);
                back();
            }
        }
    }
}